<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Spec::Example::SharedExampleGroup</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Spec::Example::SharedExampleGroup</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/plugins/rspec/lib/spec/example/shared_example_group_rb.html">
                vendor/plugins/rspec/lib/spec/example/shared_example_group.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Module
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000345">add_shared_example_group</a>&nbsp;&nbsp;
      <a href="#M000349">execute_in_class_hierarchy</a>&nbsp;&nbsp;
      <a href="#M000346">find_shared_example_group</a>&nbsp;&nbsp;
      <a href="#M000348">new</a>&nbsp;&nbsp;
      <a href="#M000347">shared_example_groups</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name"><a href="ExampleGroupMethods.html">ExampleGroupMethods</a></span>
      </div>
    </div>

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000345" class="method-detail">
        <a name="M000345"></a>

        <div class="method-heading">
          <a href="#M000345" class="method-signature">
          <span class="method-name">add_shared_example_group</span><span class="method-args">(new_example_group)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000345-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000345-source">
<pre>
   <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/shared_example_group.rb, line 5</span>
5:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_shared_example_group</span>(<span class="ruby-identifier">new_example_group</span>)
6:           <span class="ruby-identifier">guard_against_redefining_existing_example_group</span>(<span class="ruby-identifier">new_example_group</span>)
7:           <span class="ruby-identifier">shared_example_groups</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">new_example_group</span>
8:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000346" class="method-detail">
        <a name="M000346"></a>

        <div class="method-heading">
          <a href="#M000346" class="method-signature">
          <span class="method-name">find_shared_example_group</span><span class="method-args">(example_group_description)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000346-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000346-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/shared_example_group.rb, line 10</span>
10:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_shared_example_group</span>(<span class="ruby-identifier">example_group_description</span>)
11:           <span class="ruby-identifier">shared_example_groups</span>.<span class="ruby-identifier">find</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
12:             <span class="ruby-identifier">b</span>.<span class="ruby-identifier">description</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">example_group_description</span>
13:           <span class="ruby-keyword kw">end</span>
14:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000348" class="method-detail">
        <a name="M000348"></a>

        <div class="method-heading">
          <a href="#M000348" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(*args, &amp;example_group_block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000348-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000348-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/shared_example_group.rb, line 39</span>
39:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">example_group_block</span>)
40:         <span class="ruby-identifier">describe</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
41:         <span class="ruby-ivar">@example_group_block</span> = <span class="ruby-identifier">example_group_block</span>
42:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">add_shared_example_group</span>(<span class="ruby-keyword kw">self</span>)
43:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000347" class="method-detail">
        <a name="M000347"></a>

        <div class="method-heading">
          <a href="#M000347" class="method-signature">
          <span class="method-name">shared_example_groups</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000347-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000347-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/shared_example_group.rb, line 16</span>
16:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">shared_example_groups</span>
17:           <span class="ruby-comment cmt"># TODO - this needs to be global, or at least accessible from</span>
18:           <span class="ruby-comment cmt"># from subclasses of Example in a centralized place. I'm not loving</span>
19:           <span class="ruby-comment cmt"># this as a solution, but it works for now.</span>
20:           <span class="ruby-identifier">$shared_example_groups</span> <span class="ruby-operator">||=</span> []
21:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000349" class="method-detail">
        <a name="M000349"></a>

        <div class="method-heading">
          <a href="#M000349" class="method-signature">
          <span class="method-name">execute_in_class_hierarchy</span><span class="method-args">(superclass_last=false) {|example_group| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000349-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000349-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/example/shared_example_group.rb, line 49</span>
49:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">execute_in_class_hierarchy</span>(<span class="ruby-identifier">superclass_last</span>=<span class="ruby-keyword kw">false</span>)
50:         <span class="ruby-identifier">classes</span> = [<span class="ruby-keyword kw">self</span>]
51:         <span class="ruby-identifier">superclass_last</span> <span class="ruby-value">? </span><span class="ruby-identifier">classes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">ExampleMethods</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">unshift</span>(<span class="ruby-constant">ExampleMethods</span>)
52:         <span class="ruby-identifier">classes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">example_group</span><span class="ruby-operator">|</span>
53:           <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">example_group</span>
54:         <span class="ruby-keyword kw">end</span>
55:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>